#include<iostream>

using namespace std;

const int N = 1e5;
int aa[N], h, id,e[N];


int main()
{
	int m, n; cin >> m >> n;
	//int k = 0;
	int sum = 0;
	for (int i = 1; i <= n; i++)
	{
		if (h == 0 && id == 0)
		{
			cin >> e[i];
			aa[++id] = e[i];
			sum++;
			//k++;
		}
		else
		{
			cin >> e[i];
			int key = 0;
			for (int j = h + 1; j <= id; j++)
			{
				if (e[i] == aa[j])
				{
					key = 1;
					break;
				}
			}
			if (key == 0)
			{
				sum++;
				if ((id-h)<m)
				{
					aa[++id] = e[i];
					//k++;
				}
				else if ((id-h)==m)
				{
					h++;
					aa[++id] = e[i];
					//k = m - 1;
				}
			}
		}
	}
	cout << sum;
	return 0;
}
